package io.chance.receiverlei.schedule;

import io.chance.receiverlei.db.DbManager;
import lrq.common.MyLog;
import lrq.common.PropertiesUnit;
import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class DeleteRtData implements Job {

    Logger log;
    private int orderInterval = PropertiesUnit.getInt("orderInterval");

    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {

        if (log == null) {
            log = MyLog.getLogger(getClass().getSimpleName());
        }

        try {
            String sql = "delete from bd_mo_rt where DATATIME< date_sub(NOW(),INTERVAL 1 MONTH)";
            DbManager.getDbExecuter().executeUpdate(sql);
        }
        catch (Exception e) {
            log.error("删除实时数据出错", e);
        }
    }
}
